<!--
 * @Descripttion: 
 * @Author: zhanyi
 * @Date: 2021-10-27 14:14:37
 * @FilePath: \wczd-mobile\src\pages\archives\archives.vue
-->
<template>
  <div class="archives">
    <div class="globalTitle">
      <div class="top-panel-cont">
        <image class="_image_icon" @click="back" src="@/static/wczd/back.png" alt=""></image>
        <div class="title">作业许可管理</div>
      </div>
      <div class="archives1">
        <SearchBar placeholder="请输入关键字搜索" cancelButton="none" v-model="searchValue" :radius="5" />
      </div>
    </div>
    <zPaging class="_sxwh_box" :default-page-size="10" :fixed='false' :height="'100%'" ref="paging" @query="queryList" v-model="jobManagerData" :delay='200' :refresher-end-bounce-enabled="false">
      <div class="_box_item" v-for="(item,index) in jobManagerData" :key="index">
        <div class="_title">
          <div class="_left">{{item.jobType}}</div>
        </div>
        <div class="_center">
          <div class="_center_item">
            <div class="_left">作业单位</div>
            <div class="_right">{{item.jobCompany}}</div>
          </div>
          <div class="_center_item">
            <div class="_left">作业区域</div>
            <div class="_right">{{item.jobAddress}}</div>
          </div>
          <div class="_center_item">
            <div class="_left">作业期限</div>
            <div class="_right">{{item.startTm+'至'+item.endTm}}</div>
          </div>
        </div>
        <div class="_footer" @click="_goInfo(item)">
          <div class="_left">
            详情
          </div>
          <div class="_right">
            <image class="_image_icon" src="@/static/wczd/more.png" alt="">
          </div>
        </div>
      </div>
    </zPaging>
  </div>
</template>

<script>
import SearchBar from "@/components/uni-search-bar/uni-search-bar.vue";
import { jobManagerInfoList } from "@/api/jobManager";
import zPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin'
import customNomore from '@/pages/component/custom-nomore/custom-nomore.vue'

export default {
  name: 'archives',
  components: { SearchBar, zPaging, customNomore },
  mixins: [ZPagingMixin],
  data () {
    return {
      searchValue: "",
      jobManagerData: []
    }
  },
  watch: {
    searchValue () {
      this.queryList(1, 10)
    }
  },
  methods: {
    // z-paging 查询方法
    queryList (pageNo, pageSize) {
      console.log(pageNo, pageSize);
      uni.showLoading({
        title: '加载中'
      });
      jobManagerInfoList({ jobType: this.searchValue }, { pageNum: pageNo, pageSize: pageSize }).then(res => {
        this.$refs.paging.complete(res.rows);
        uni.hideLoading();
      })
    },
    back () {
      uni.navigateBack({
        delta: 1
      });
    },
    _goInfo (item) {
      uni.navigateTo({
        url: `/pages/archives/archives-edit?id=${item.id}`,
      })
    }
  },
}
</script>

<style scoped lang="scss">
.globalTitle {
  position: fixed;
  z-index: 99;
}
.archives {
  height: 100%;
}
._sxwh_box {
  padding-top: 200upx;
  height: 100%;
}
.title {
  padding-left: 0;
}
.top-panel-cont {
  display: flex;
  align-items: center;
  image {
    margin-left: 30upx;
    margin-top: 20upx;
    width: 56upx;
    height: 56upx;
  }
  div {
    font-size: 40upx;
    font-weight: bold;
  }
}
.globalTitle .archives1 {
  margin-top: 10upx;
}
</style>
